package com.hnzq.cloud.api;

import com.hnzq.cloud.IO.AddSendOrderIO;
import com.hnzq.cloud.IO.DelOrderForSendIO;
import com.hnzq.cloud.IO.EditSendOrderIO;
import com.hnzq.cloud.IO.entity.FreSend;
import com.hnzq.cloud.model.Result;
import com.hnzq.cloud.util.FreException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "send-assembly",contextId = "freSend",path = "freSend")
public interface FreSendOrderApi {
    /**
    * @作者: tiangle
    * @描述：根据id查询send订单
    * @时间：2022/2/9 0:53
    * @参数类型:[id]
    * @返回：com.hnzq.cloud.util.Result
    **/
    @GetMapping("getById")
    Result<FreSend> getById(@RequestParam("id")Long id);
    @GetMapping("getOrders")
    Result<List<Integer>> getOrders(@RequestParam("id")Long id);
    @GetMapping("getSendByDriver")
    Result<FreSend> getByDriver(@RequestParam("id")Integer id) throws FreException;
    @GetMapping("getSendByOrder")
    Result<FreSend> getSendByOrder(@RequestParam("id")Integer id);
    @GetMapping("getAll")
    Result<List<FreSend>> getAll();
    @PostMapping("add")
    Result<Long> addSendOrder(@RequestBody AddSendOrderIO addSend) throws FreException;

    @PutMapping("edit")
    Result editSendOrder(@RequestBody EditSendOrderIO editSend) throws FreException;

    @PutMapping("changeStatus")
    Result editStatus(@RequestBody EditSendOrderIO editSend) throws FreException;

    @PutMapping("addOrderToSend")
    Result addToSend(@RequestBody AddSendOrderIO addSendOrderIO) throws FreException;

    @PutMapping("deleteOrderForSend")
    Result deleteForSend(@RequestBody DelOrderForSendIO delOrderForSendIO) throws FreException;

    @DeleteMapping("deleteSend")
    Result deleteSend(@RequestParam("id") Long id) throws FreException;


}
